|
There are three different modes of visibility for methods or attributes in Objective VHDL. They can be compared to C++'s public, protected and private visibility, although Objective VHDL does not provide the same possibilities as C++. For those who are not familiar with C++ a short explanation of private, protected and public follows. If a method or attribute is private it cannot be accessed outside the class, even in derived classes access is not possible. In contrast to private, protected methods or attributes may be accessed by derived classes, but like private methods or attributes they may not be accessed outside the class. Public methods are accessible from everywhere, from outside the class or in derived classes. For public attributes the same is true, but they do not exist in Objective VHDL. |
In Objective VHDL methods are always public or private and attributes are always protected or private. The mode of visibility is not bound to a keyword. It just depends on the position, where the declaration is made. Methods and attributes which are declared in the class body are private. Methods which are declared in the class declaration are public and attributes accordingly protected.
|